<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>关注粉丝管理</title>
	<link rel="stylesheet" type="text/css" href="${basePath}/css/style-1.css" />
	<link rel="stylesheet" type="text/css" href="${basePath}/css/style_2_common.css" />
	<link rel="stylesheet" type="text/css" href="${basePath}/css/cymain.css" />
	<script type="text/javascript" src="${basePath}/js/jquery-1.8.3.min.js"></script>
		<link rel="stylesheet" type="text/css" href="${basePath}/js/layer/skin/layer.css" />
		<link rel="shortcut icon" type="image/ico" href="${basePath}/favicon.ico?v=1"/>
    <script type="text/javascript" src="${basePath}/js/layer/layer.m.js"></script>
   <script type="text/javascript" src="${basePath}/js/emoji.js"></script>
	<script type="text/javascript">
	function openLay(openid,name){
		var dialog = function(){
			 var layerIndex = layer.open({
			    type: 2,
			    area: ['700px', '530px'],
			    title:name,
			    skin: 'layui-layer-rim', //加上边框
			    content: '${basePath}/admin/fansBehavior/fan?openid='+openid
			});
			return layerIndex;
		}
		window.layerIndex = dialog();
	}
	$(document).ready(function(){
		$("#check_box").click(function(){
			if($("#check_box").attr("checked")){
				$(":checkbox").attr("checked", true); 
  				}else {
       			$(":checkbox").attr("checked", false);  
   			}
		});
		$("#msgSearch").click(function(){
			 page(1);
		});
		$('.emoji').emoji();
	})
	function changeGroup(){
		var ids=document.getElementsByName('fanids');
		var idStr=''; 
		for(var i=0; i<ids.length; i++){ 
		    if(ids[i].checked) 
		    	idStr+=ids[i].value+','; //如果选中，将value添加到变量s中 
		} 
		if(idStr==""||idStr==null){
			alert("请选择要转移的粉丝");
			return;
		}
		var groupid1 = $('#groupid1  option:selected').val();
		var groupid2 = $('#groupid2  option:selected').val();
		window.location.href="change?currentPage=${page.currentPage!}&keyword="+$("#keyword").val()+"&groupid1="+groupid1+"&groupid2="+groupid2+"&idStr="+idStr;
 
	}
	function page(currentPage){
		var groupid = $('#groupid1  option:selected').val();
		window.location.href="index?currentPage="+currentPage+"&keyword="+$("#keyword").val()+"&wechatgroupid="+groupid+"&subscribe="+$("#subscribe").val();
	}
</script>
	
</head>
<body id="nv_member" class="pg_CURMODULE">
	<#assign current='menu_fan'>
	<div id="wp" class="wp">
		<#include "/include/header.html"/>
		<!--中间内容-->
		<div class="contentmanage">
			<div class="developer">
				<div class="tableContent">
					<#include "/include/left.html"/>
					<#include "/include/wxtop.html"/>
					<div class="content">
						<div class="cLineB">
							<h4 style="font-size:16px;">关注粉丝管理</h4>
							<div class="clr"></div>
							</div>
							<div class="cLine">
								<div style="margin: 0 auto" class="ftip">认证公众号才能使用此功能，点击下面的“同步粉丝信息”便会同步您的粉丝信息</div>
							</div>
							<div class="cLine">
								<div class=" left">
									 <a class="btnGrayS vm bigbtn" href="${basePath}/admin/fansUser/toUpdate"><img class="vm" src="${basePath}/images/text.png">同步粉丝信息</a>
								</div>
								<div class="clr"></div>
							</div>
							<div style="border-top: 1px solid #ccc; padding-top: 10px; margin-top: 10px;" class="msgWrap">
								<div style="margin: 5px 0">
									<div style="float: left; width: 60%;">
											<input type="text" value="${keyword?default('')}" name="keyword" id="keyword" placeholder="输入昵称搜索" class="px" id="msgSearchInput1" />
											&nbsp;&nbsp;
											按分组查看粉丝： 
											       <select id="groupid1" name="groupid1">
											          <option value="">全部</option>
											          <#list grouList as group >		
											  		    <option value="${group.groupId}" <#if group.groupId == wechatgroupid> selected="selected" </#if>>${group.name}</option>
													  </#list>	
											      </select>
											按是否关注：      
											    <select id="subscribe" name="subscribe">
											          <option value="">全部</option>
											  		   <option value="1" <#if subscribe=='1'> selected="selected" </#if> >已关注 </option>
											  		   <option value="0" <#if subscribe=='0'> selected="selected"  </#if> >取消关注 </option>
											      </select>  
											<input type="button" title="搜索" class="btnGrayS" id="msgSearch" value="搜索" />
									</div>
									<div style="width: 40%; float: right">
											将选中粉丝转移到分组中 <select name="groupid2" id="groupid2">			
													<#list grouList as group >		
											  		 <option value=${group.groupId}>${group.name}</option>
													</#list>
											</select> 
											<input type="button" title="转移" class="btnGrayS" href="" id="msgSearchBtn" onClick="changeGroup();" value="转移">
											
										</div>
										<div style="clear: both"></div>
								
								</div>
								<table class="ListProduct Shallow_border_color" border="0" cellSpacing="0" cellPadding="0" width="100%">
									<thead>
										<tr>
											<th class="select"><input type="checkbox"  id="check_box"></th>
											<th>头像</th>
											<th>粉丝昵称</th>
											<th>性别</th>
											<th>分组名</th>
											<th>省(直辖市)</th>
											<th>城市</th>
											<th  style="width:110px;">关注时间</th>
											<th class="norightborder">操作</th>
										</tr>
									</thead>
									<tbody>
										<#if page?exists>
										<#list page.recordList as bean >
											<tr>
												<td><input type="checkbox" name="fanids" id="fanids" class="cbitem" value="${bean.id}"></td>
												<td style="width:50px;"><div class="cateimg">
														<img class="cateimg_small" src="${bean.headimgurl?default('')}">
													</div>
												</td>
												<td><div class='emoji'> ${bean.nickname?default('')} </div></td>
												<td>
													<#if bean.sex==1>男
													<#elseif bean.sex==2>女
													<#else>未知</#if>													
												</td>
												<td> ${bean.groupidStr}</td>
												<td>${bean.province?default('')}</td>
												<td>${bean.city?default('')}</td>
												<td>${bean.subscribeTime?datetime}</td>											
												<td class="norightborder"><a href="javascript:void(0);" onclick="openLay('${bean.openid}','${bean.nickname}')" class="behiver">消息统计</a></td>
											</tr>
										</#list>
										</#if>
									</tbody>
								</table>
							</from>
							</div>				
						<#include "/include/form_pagination.html"/>					
					</div>
					<div class="clr"></div>
				</div>
			</div>
		</div>
		<!--底部-->
	</div>
	<#include "/include/footer.html"/>
</body>
</html>